package com.sqf.test;

import com.sqf.dao.JpaDao;
import com.sqf.dao.JpaDao1;
import com.sqf.entity.T_user;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.Date;
import java.util.List;
import java.util.Optional;

@RunWith(SpringRunner.class)
@SpringBootTest
public class Rk10_JpaTest1 {

    @Autowired
    JpaDao1 jpaDao1;

    @Test
    public void test1(){
        List<T_user> 飞 = jpaDao1.findByNameLike("%飞%");
        System.out.println(飞);
    }

    @Test//大于
    public void test2(){
        List<T_user> by = jpaDao1.findByNameLikeAndBirthdayGreaterThan("%飞%", new Date());
        System.out.println(by);
    }

    @Test//小于
    public void test3(){
        List<T_user> byBirthdayLessThan = jpaDao1.findByBirthdayLessThan(new Date());
        System.out.println(byBirthdayLessThan);
    }



}
